package BC;

import org.bouncycastle.util.encoders.Hex;

import java.nio.charset.StandardCharsets;

public class sm3_demo {
    public static void main(String[] args){
        GMUtil sm3 = new GMUtil();
        String plaintext="lzc_SM3_demo";
        String key="lzc";
        byte[] sigValue=sm3.sm3HMAC(plaintext,key);
        System.out.println("原文: \t" + Hex.toHexString(plaintext.getBytes(StandardCharsets.UTF_8)));
        System.out.println("密钥: \t" + Hex.toHexString(key.getBytes(StandardCharsets.UTF_8)));
        System.out.println("签名值: \t" + Hex.toHexString(sigValue));
    }
}
